<?php
namespace app\admin\library;

class Upload{
    public static function base(){
        return '/upload';
    }

    public static function url(string|null $file){
        if ($file!=null && $file!='' ) return self::base().$file;
        return '';
    }

    public static function restoreUrl($url){
        if (strpos($url,self::base())===0){
            return substr($url,strlen(self::base()));
        }
    }
}